package design.mode.factory.dependencyInjection;

import design.mode.factory.dependencyInjection.context.ApplicationContext;
import design.mode.factory.dependencyInjection.context.ClassPathXmlApplicationContext;
import design.mode.factory.dependencyInjection.redis.RateLimiter;

/**
 * @author ZhongMingde on 2021/10/28
 */

public class Demo {
    public static void main(String[] args) {

        String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath();

        System.out.println(basePath);
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("design/mode/factory/dependencyInjection/beans.xml");
        RateLimiter rateLimiter = (RateLimiter) applicationContext.getBean("rateLimiter");
        rateLimiter.test();
    }
}
